-----------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:\Ellen\Dropbox\Pajaro_AgInnovation\Submission\JAERE\Replication_Code\Log\D
> inD_annual_log.log
  log type:  text
 opened on:  29 Nov 2023, 16:54:57

. 
. *SELECT DATASET
. global dataset 2         

. global quarterly "Data\Parcel_Clean_20230626.dta"

. global yearrun "Data\Parcel_Clean_yearrun_20230626.dta"

. 
. if $dataset == 1 use $quarterly, clear

. if $dataset == 2 use $yearrun, clear

. 
. *GENERATE LAG DELIVERIES -- TOGGLE ON/OFF BASED ON CALLED DATASET
. *sort parcelnum quarter 
. *by parcelnum: gen lagdelivered = delivered[_n-1]
. 
. sort parcelnum year_run 

. by parcelnum: gen lagdelivered = delivered[_n-1]
(19,084 missing values generated)

. 
. ********************************************************************************
. *TABLE 2: ANNUAL EXTRACTION DIFF IN DIFF
. ********************************************************************************
. *Balance the panel
. preserve

. bysort parcelnum: gen ntime = [_N]

. sum ntime

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       ntime |     28,848    5.919024    6.578618          1         15

. keep if ntime==`r(max)'
(19,488 observations deleted)

. 
. *Drop 2010
. drop if year_run==5 
(624 observations deleted)

. drop if year_run >10
(3,120 observations deleted)

. 
. 
. drop if gridid_500m == . 
(18 observations deleted)

. 
. putexcel set "Tables\price_change_$outputdate.xlsx", replace
Note: file will be replaced when the first putexcel command is issued

. bys inside: sum price if post==0

-----------------------------------------------------------------------------------------
-> inside = 0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       price |      2,204    114.9425    35.72438         80        160

-----------------------------------------------------------------------------------------
-> inside = 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       price |        284         115    35.77017         80        160


. putexcel A1 = "Pre Price"
file Tables\price_change_20231129.xlsx saved

. putexcel B1 = `r(mean)'
file Tables\price_change_20231129.xlsx saved

. 
. sum price if post==1 & inside==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       price |        351    206.9646    8.220954        195        220

. putexcel A2 = "Post Inside"
file Tables\price_change_20231129.xlsx saved

. putexcel B2 = `r(mean)'
file Tables\price_change_20231129.xlsx saved

. sum price if post==1 & inside==0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       price |      2,759     171.666     6.60238        162        191

. putexcel A3 = "Post Outside"
file Tables\price_change_20231129.xlsx saved

. putexcel B3 = `r(mean)'
file Tables\price_change_20231129.xlsx saved

. 
. 
. bys inside: sum extraction if post==0

-----------------------------------------------------------------------------------------
-> inside = 0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  extraction |      2,204    62.97923    93.92226          0   1063.572

-----------------------------------------------------------------------------------------
-> inside = 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
  extraction |        284      129.26    151.6099          0    764.881


. 
. eststo clear

. 
. *Column 1: No FE
. eststo: reg extraction treatment post inside if year_run <11, cluster(parcelnum)

Linear regression                               Number of obs     =      5,598
                                                F(3, 621)         =       5.75
                                                Prob > F          =     0.0007
                                                R-squared         =     0.0281
                                                Root MSE          =     100.02

                            (Std. Err. adjusted for 622 clusters in parcelnum)
------------------------------------------------------------------------------
             |               Robust
  extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |  -27.23693   11.46628    -2.38   0.018    -49.75431   -4.719544
        post |  -2.195932   1.345224    -1.63   0.103    -4.837671    .4458062
      inside |   66.28077   17.78426     3.73   0.000     31.35619    101.2053
       _cons |   62.97923   3.868396    16.28   0.000     55.38251    70.57596
------------------------------------------------------------------------------
(est1 stored)

.         estadd local wellFE " "

added macro:
             e(wellFE) : " "

.         estadd local timeFE " "

added macro:
             e(timeFE) : " "

.         estadd local controls " "

added macro:
           e(controls) : " "

.         predict water_hat_1
(option xb assumed; fitted values)

.         gen water_hat_nettreat_1 = water_hat_1-_b[treatment]

.         gen change_1 = _b[treatment]/water_hat_nettreat_1

. *Column 2: Add well FE
. eststo: xtreg extraction treatment post if year_run <11, fe cluster(parcelnum) 

Fixed-effects (within) regression               Number of obs     =      5,598
Group variable: parcelnum                       Number of groups  =        622

R-sq:                                           Obs per group:
     within  = 0.0220                                         min =          9
     between = 0.0302                                         avg =        9.0
     overall = 0.0057                                         max =          9

                                                F(2,621)          =       4.91
corr(u_i, Xb)  = -0.1565                        Prob > F          =     0.0076

                            (Std. Err. adjusted for 622 clusters in parcelnum)
------------------------------------------------------------------------------
             |               Robust
  extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |  -29.17889   11.46749    -2.54   0.011    -51.69864   -6.659138
        post |  -2.062008   1.363264    -1.51   0.131    -4.739175    .6151584
       _cons |   70.54505   .9797244    72.00   0.000     68.62107    72.46902
-------------+----------------------------------------------------------------
     sigma_u |  95.975251
     sigma_e |  37.603478
         rho |    .866919   (fraction of variance due to u_i)
------------------------------------------------------------------------------
(est2 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local timeFE " "

added macro:
             e(timeFE) : " "

.         estadd local controls " "

added macro:
           e(controls) : " "

.         predict water_hat_2
(option xb assumed; fitted values)

.         gen water_hat_nettreat_2 = water_hat_2-_b[treatment]

.         gen change_2 = _b[treatment]/water_hat_nettreat_2

. *Column 3: Add year FE
. eststo: xtreg extraction treatment i.year_run if year_run <11, fe cluster(parcelnum)

Fixed-effects (within) regression               Number of obs     =      5,598
Group variable: parcelnum                       Number of groups  =        622

R-sq:                                           Obs per group:
     within  = 0.0392                                         min =          9
     between = 0.0302                                         avg =        9.0
     overall = 0.0015                                         max =          9

                                                F(9,621)          =      12.55
corr(u_i, Xb)  = -0.1316                        Prob > F          =     0.0000

                            (Std. Err. adjusted for 622 clusters in parcelnum)
------------------------------------------------------------------------------
             |               Robust
  extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   treatment |  -29.11865   11.47235    -2.54   0.011    -51.64794   -6.589353
             |
    year_run |
          2  |   9.193506   1.750611     5.25   0.000     5.755672    12.63134
          3  |   8.794646   1.641146     5.36   0.000     5.571778    12.01751
          4  |   4.526654   1.838104     2.46   0.014     .9170022    8.136306
          6  |  -4.803717   1.807799    -2.66   0.008    -8.353858   -1.253576
          7  |   3.585383   2.008409     1.79   0.075    -.3587128    7.529479
          8  |   6.435632    1.97469     3.26   0.001     2.557752    10.31351
          9  |   11.34963   2.260383     5.02   0.000     6.910708    15.78855
         10  |   1.232549   1.984707     0.62   0.535    -2.665002    5.130099
             |
       _cons |   64.91634   1.429178    45.42   0.000     62.10974    67.72295
-------------+----------------------------------------------------------------
     sigma_u |  95.972865
     sigma_e |  37.295791
         rho |  .86879771   (fraction of variance due to u_i)
------------------------------------------------------------------------------
(est3 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local timeFE " \checkmark  "

added macro:
             e(timeFE) : " \checkmark  "

.         estadd local controls " "

added macro:
           e(controls) : " "

.         predict water_hat_3
(option xb assumed; fitted values)

.         gen water_hat_nettreat_3 = water_hat_3-_b[treatment]

.         gen change_3 = _b[treatment]/water_hat_nettreat_3

. *Column 4: Add county-year FE
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(parc
> elnum)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs     =      5,598
Group variable: parcelnum                       Number of groups  =        622

R-sq:                                           Obs per group:
     within  = 0.0413                                         min =          9
     between = 0.0179                                         avg =        9.0
     overall = 0.0001                                         max =          9

                                                F(17,621)         =       7.29
corr(u_i, Xb)  = -0.1019                        Prob > F          =     0.0000

                                    (Std. Err. adjusted for 622 clusters in parcelnum)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   10.97243    -2.57   0.011    -49.70086   -6.605747
                     |
year_run#county_code |
                1 2  |   -1.53619   2.274629    -0.68   0.500    -6.003088    2.930707
                2 1  |     13.251   3.936044     3.37   0.001     5.521426    20.98056
                2 2  |   5.589178   2.448659     2.28   0.023     .7805237    10.39783
                3 1  |   11.79079   3.741091     3.15   0.002     4.444067    19.13751
                3 2  |   5.731295   2.268515     2.53   0.012     1.276405    10.18618
                4 1  |   5.999133   4.325548     1.39   0.166     -2.49534    14.49361
                4 2  |   2.239928    2.08252     1.08   0.283    -1.849707    6.329564
                6 1  |  -8.484035   3.931052    -2.16   0.031     -16.2038   -.7642692
                6 2  |  -4.630375   1.652435    -2.80   0.005    -7.875414   -1.385337
                7 1  |   3.533742   4.865999     0.73   0.468    -6.022065    13.08955
                7 2  |     1.9115   1.982344     0.96   0.335    -1.981409    5.804409
                8 1  |   6.551699   4.529074     1.45   0.149    -2.342457    15.44585
                8 2  |   4.676267   1.989063     2.35   0.019     .7701622    8.582372
                9 1  |   14.93545   5.128205     2.91   0.004     4.864722    25.00617
                9 2  |   7.821699   1.731387     4.52   0.000     4.421616    11.22178
               10 1  |   .3150511   4.203593     0.07   0.940    -7.939929    8.570032
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.701408    38.75   0.000     62.59267     69.2751
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est4 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local timeFE " "

added macro:
             e(timeFE) : " "

.         estadd local controls " \checkmark  "

added macro:
           e(controls) : " \checkmark  "

.         predict water_hat_4
(option xb assumed; fitted values)

.         gen water_hat_nettreat_4 = water_hat_4-_b[treatment]

.         gen change_4 = _b[treatment]/water_hat_nettreat_4

. esttab using "Tables\Extraction_DinD_$outputdate.tex", label replace ///
>         se star(* .10 ** .05 *** .01) ///
>         addnote(Table reports results from diff-in-diff regression. Standard errors are
>  clustered at the parcel level.) ///
>         keep(_cons post treatment inside) ///
>         scalars("wellFE Parcel FE" "timeFE Year FE" "controls County-Year FE") ///
>         cells(b(star fmt(2)) se(par fmt(2)))
(output written to Tables\Extraction_DinD_20231129.tex)

. eststo clear

. 
. ********************************************************************************
. *TABLE 10: VARY CLUSTERING OF STANDARD ERRORS
. ********************************************************************************
. *Column 1: main - parcelnum 
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(parc
> elnum)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs     =      5,598
Group variable: parcelnum                       Number of groups  =        622

R-sq:                                           Obs per group:
     within  = 0.0413                                         min =          9
     between = 0.0179                                         avg =        9.0
     overall = 0.0001                                         max =          9

                                                F(17,621)         =       7.29
corr(u_i, Xb)  = -0.1019                        Prob > F          =     0.0000

                                    (Std. Err. adjusted for 622 clusters in parcelnum)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   10.97243    -2.57   0.011    -49.70086   -6.605747
                     |
year_run#county_code |
                1 2  |   -1.53619   2.274629    -0.68   0.500    -6.003088    2.930707
                2 1  |     13.251   3.936044     3.37   0.001     5.521426    20.98056
                2 2  |   5.589178   2.448659     2.28   0.023     .7805237    10.39783
                3 1  |   11.79079   3.741091     3.15   0.002     4.444067    19.13751
                3 2  |   5.731295   2.268515     2.53   0.012     1.276405    10.18618
                4 1  |   5.999133   4.325548     1.39   0.166     -2.49534    14.49361
                4 2  |   2.239928    2.08252     1.08   0.283    -1.849707    6.329564
                6 1  |  -8.484035   3.931052    -2.16   0.031     -16.2038   -.7642692
                6 2  |  -4.630375   1.652435    -2.80   0.005    -7.875414   -1.385337
                7 1  |   3.533742   4.865999     0.73   0.468    -6.022065    13.08955
                7 2  |     1.9115   1.982344     0.96   0.335    -1.981409    5.804409
                8 1  |   6.551699   4.529074     1.45   0.149    -2.342457    15.44585
                8 2  |   4.676267   1.989063     2.35   0.019     .7701622    8.582372
                9 1  |   14.93545   5.128205     2.91   0.004     4.864722    25.00617
                9 2  |   7.821699   1.731387     4.52   0.000     4.421616    11.22178
               10 1  |   .3150511   4.203593     0.07   0.940    -7.939929    8.570032
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.701408    38.75   0.000     62.59267     69.2751
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est1 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local controls " \checkmark "

added macro:
           e(controls) : " \checkmark "

.         estadd local clusters " 624 "

added macro:
           e(clusters) : " 624 "

. *Column 2: 400m
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(grid
> id_400m)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =      5598
Group variable: parcelnum                       Number of groups   =       622

R-sq:  within  = 0.0413                         Obs per group: min =         9
       between = 0.0179                                        avg =       9.0
       overall = 0.0001                                        max =         9

                                                F(17,530)          =      7.28
corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000

                                  (Std. Err. adjusted for 531 clusters in gridid_400m)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   11.09729    -2.54   0.011    -49.95337   -6.353234
                     |
year_run#county_code |
                1 2  |   -1.53619   2.256851    -0.68   0.496    -5.969662    2.897281
                2 1  |     13.251   3.964281     3.34   0.001     5.463364    21.03863
                2 2  |   5.589178   2.436132     2.29   0.022     .8035192    10.37484
                3 1  |   11.79079   3.774195     3.12   0.002     4.376573    19.20501
                3 2  |   5.731295   2.233544     2.57   0.011     1.343609    10.11898
                4 1  |   5.999133   4.354864     1.38   0.169    -2.555779    14.55405
                4 2  |   2.239928   2.064798     1.08   0.278    -1.816264     6.29612
                6 1  |  -8.484035   3.911768    -2.17   0.031    -16.16851   -.7995624
                6 2  |  -4.630375   1.642846    -2.82   0.005    -7.857663   -1.403087
                7 1  |   3.533742    4.75266     0.74   0.457    -5.802621     12.8701
                7 2  |     1.9115   1.985244     0.96   0.336    -1.988413    5.811413
                8 1  |   6.551699   4.515127     1.45   0.147    -2.318042    15.42144
                8 2  |   4.676267   1.991017     2.35   0.019     .7650136     8.58752
                9 1  |   14.93545   5.115164     2.92   0.004     4.886961    24.98393
                9 2  |   7.821699   1.744387     4.48   0.000     4.394939    11.24846
               10 1  |   .3150511   4.186308     0.08   0.940    -7.908743    8.538845
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.703574    38.70   0.000      62.5873    69.28047
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est2 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local controls " \checkmark "

added macro:
           e(controls) : " \checkmark "

.         estadd local clusters " 531 "

added macro:
           e(clusters) : " 531 "

. *Column 3: 500m
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(grid
> id_500m)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =      5598
Group variable: parcelnum                       Number of groups   =       622

R-sq:  within  = 0.0413                         Obs per group: min =         9
       between = 0.0179                                        avg =       9.0
       overall = 0.0001                                        max =         9

                                                F(17,455)          =      7.64
corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000

                                  (Std. Err. adjusted for 456 clusters in gridid_500m)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   9.962104    -2.83   0.005    -47.73074   -8.575862
                     |
year_run#county_code |
                1 2  |   -1.53619   2.230278    -0.69   0.491    -5.919114    2.846733
                2 1  |     13.251   3.938601     3.36   0.001     5.510891     20.9911
                2 2  |   5.589178   2.408925     2.32   0.021       .85518    10.32318
                3 1  |   11.79079   3.776432     3.12   0.002     4.369378     19.2122
                3 2  |   5.731295   2.277025     2.52   0.012     1.256506    10.20608
                4 1  |   5.999133   4.360824     1.38   0.170    -2.570721    14.56899
                4 2  |   2.239928   2.059508     1.09   0.277    -1.807399    6.287256
                6 1  |  -8.484035   3.726229    -2.28   0.023    -15.80679   -1.161281
                6 2  |  -4.630375   1.618614    -2.86   0.004    -7.811262   -1.449489
                7 1  |   3.533742   4.535829     0.78   0.436    -5.380031    12.44751
                7 2  |     1.9115   1.970425     0.97   0.333    -1.960762    5.783762
                8 1  |   6.551699   4.466874     1.47   0.143    -2.226563    15.32996
                8 2  |   4.676267   1.994645     2.34   0.019      .756408    8.596126
                9 1  |   14.93545    5.00732     2.98   0.003     5.095104    24.77579
                9 2  |   7.821699   1.689373     4.63   0.000     4.501758    11.14164
               10 1  |   .3150511   4.196131     0.08   0.940    -7.931149    8.561251
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.619019    40.72   0.000      62.7522    69.11557
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est3 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local controls " \checkmark "

added macro:
           e(controls) : " \checkmark "

.         estadd local clusters " 456 "

added macro:
           e(clusters) : " 456 "

. *Column 4: 600m
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(grid
> id_600m)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =      5598
Group variable: parcelnum                       Number of groups   =       622

R-sq:  within  = 0.0413                         Obs per group: min =         9
       between = 0.0179                                        avg =       9.0
       overall = 0.0001                                        max =         9

                                                F(17,404)          =      7.46
corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000

                                  (Std. Err. adjusted for 405 clusters in gridid_600m)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   10.15852    -2.77   0.006    -48.12345   -8.183152
                     |
year_run#county_code |
                1 2  |   -1.53619   2.125917    -0.72   0.470    -5.715431     2.64305
                2 1  |     13.251   4.098073     3.23   0.001     5.194785    21.30721
                2 2  |   5.589178   2.348664     2.38   0.018     .9720488    10.20631
                3 1  |   11.79079   3.969282     2.97   0.003     3.987765    19.59382
                3 2  |   5.731295   2.145885     2.67   0.008       1.5128     9.94979
                4 1  |   5.999133   4.574671     1.31   0.190    -2.993999    14.99227
                4 2  |   2.239928   1.926532     1.16   0.246    -1.547351    6.027208
                6 1  |  -8.484035   3.627614    -2.34   0.020    -15.61539   -1.352678
                6 2  |  -4.630375   1.531919    -3.02   0.003    -7.641904   -1.618847
                7 1  |   3.533742   4.661341     0.76   0.449     -5.62977    12.69725
                7 2  |     1.9115    1.91745     1.00   0.319    -1.857925    5.680925
                8 1  |   6.551699   4.262449     1.54   0.125    -1.827652    14.93105
                8 2  |   4.676267   1.948868     2.40   0.017     .8450792    8.507455
                9 1  |   14.93545   5.294391     2.82   0.005      4.52745    25.34344
                9 2  |   7.821699   1.659827     4.71   0.000     4.558722    11.08468
               10 1  |   .3150511   3.963834     0.08   0.937    -7.477265    8.107367
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.635348    40.32   0.000     62.71903    69.14874
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est4 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local controls " \checkmark "

added macro:
           e(controls) : " \checkmark "

.         estadd local clusters " 405 "

added macro:
           e(clusters) : " 405 "

. *Column 5: 1km
. eststo: xtreg extraction treatment i.year_run#i.county if year_run <11, fe cluster(grid
> id_1000m)
note: 10.year_run#2.county_code omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =      5598
Group variable: parcelnum                       Number of groups   =       622

R-sq:  within  = 0.0413                         Obs per group: min =         9
       between = 0.0179                                        avg =       9.0
       overall = 0.0001                                        max =         9

                                                F(17,221)          =     10.03
corr(u_i, Xb)  = -0.1019                        Prob > F           =    0.0000

                                 (Std. Err. adjusted for 222 clusters in gridid_1000m)
--------------------------------------------------------------------------------------
                     |               Robust
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
           treatment |   -28.1533   10.53675    -2.67   0.008    -48.91866   -7.387944
                     |
year_run#county_code |
                1 2  |   -1.53619   2.136757    -0.72   0.473    -5.747217    2.674836
                2 1  |     13.251   4.150678     3.19   0.002     5.071021    21.43097
                2 2  |   5.589178   2.332979     2.40   0.017     .9914458    10.18691
                3 1  |   11.79079   3.691665     3.19   0.002     4.515418    19.06616
                3 2  |   5.731295   2.108323     2.72   0.007     1.576304    9.886286
                4 1  |   5.999133   4.442294     1.35   0.178    -2.755546    14.75381
                4 2  |   2.239928   1.973374     1.14   0.258     -1.64911    6.128967
                6 1  |  -8.484035   3.398113    -2.50   0.013    -15.18089   -1.787182
                6 2  |  -4.630375    1.59372    -2.91   0.004     -7.77121   -1.489541
                7 1  |   3.533742   4.540876     0.78   0.437    -5.415219     12.4827
                7 2  |     1.9115    1.84772     1.03   0.302    -1.729906    5.552906
                8 1  |   6.551699     4.5965     1.43   0.155    -2.506883    15.61028
                8 2  |   4.676267    1.95159     2.40   0.017     .8301596    8.522374
                9 1  |   14.93545   4.963878     3.01   0.003     5.152852    24.71804
                9 2  |   7.821699   1.694578     4.62   0.000     4.482099     11.1613
               10 1  |   .3150511   4.053531     0.08   0.938    -7.673471    8.303574
               10 2  |          0  (omitted)
                     |
               _cons |   65.93389   1.695577    38.89   0.000     62.59232    69.27545
---------------------+----------------------------------------------------------------
             sigma_u |  95.723931
             sigma_e |  37.285615
                 rho |  .86826693   (fraction of variance due to u_i)
--------------------------------------------------------------------------------------
(est5 stored)

.         estadd local wellFE " \checkmark  "

added macro:
             e(wellFE) : " \checkmark  "

.         estadd local controls " \checkmark "

added macro:
           e(controls) : " \checkmark "

.         estadd local clusters " 222 "

added macro:
           e(clusters) : " 222 "

. esttab using "Tables\Extraction_DinD_cluster_combo_$outputdate.tex", label replace ///
>         se star(* .10 ** .05 *** .01) ///
>         addnote(Table reports results from an annual difference-in-differences regressi
> on at the parcel level. Standard errors are clustered at various levels of spatial aggr
> egation. *, **, *** denote significance at the 10\%, 5\%, and 1\% levels. A grid with 5
> 00m-length squares contains 4 average-sized parcels (or 9 median-sized parcels).) ///
>         keep(_cons treatment) ///
>         scalars("wellFE Parcel FE" "controls County-Year FE") ///
>         cells(b(star fmt(2)) se(par fmt(2)))
(output written to Tables\Extraction_DinD_cluster_combo_20231129.tex)

. eststo clear

. restore

. 
. ********************************************************************************
. **TABLE 3: Extraction pre-trends table test
. ********************************************************************************
. *HAVE TO BE SEPARATE BECAUSE THEY CALL SEPARARE DATASETS DEFINED AT TOP
. *USE YEAR_RUN DATA HERE
. *COLUMNS (1) and (2) 
. eststo clear

. preserve

. keep if post==0
(25,339 observations deleted)

. *Step 1: year FE
. eststo: reg extraction year_run i.inside#c.year_run inside i.year_run
note: 5.year_run omitted because of collinearity

      Source |       SS           df       MS      Number of obs   =     3,509
-------------+----------------------------------   F(6, 3502)      =     12.10
       Model |  681944.565         6  113657.428   Prob > F        =    0.0000
    Residual |  32895709.6     3,502  9393.40651   R-squared       =    0.0203
-------------+----------------------------------   Adj R-squared   =    0.0186
       Total |  33577654.2     3,508  9571.73722   Root MSE        =     96.92

-----------------------------------------------------------------------------------
       extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
         year_run |  -1.590887   1.371754    -1.16   0.246    -4.280404    1.098631
                  |
inside#c.year_run |
               1  |  -4.456736    3.36458    -1.32   0.185    -11.05347        2.14
                  |
           inside |    49.8618    11.1747     4.46   0.000     27.95222    71.77138
                  |
         year_run |
               2  |   8.527547   4.662986     1.83   0.068    -.6148984    17.66999
               3  |   11.67995   4.509482     2.59   0.010     2.838468    20.52143
               4  |   7.827104   4.638534     1.69   0.092    -1.267399    16.92161
               5  |          0  (omitted)
                  |
            _cons |    56.4191   4.934758    11.43   0.000     46.74381    66.09439
-----------------------------------------------------------------------------------
(est1 stored)

. estadd local year "\checkmark"

added macro:
               e(year) : "\checkmark"

. estadd local yc " "     

added macro:
                 e(yc) : " "

. *Step 1: county-year FE
. eststo: reg extraction year_run i.inside#c.year_run inside i.year_run#i.county
note: 5.year_run#2.county_code omitted because of collinearity

      Source |       SS           df       MS      Number of obs   =     3,509
-------------+----------------------------------   F(11, 3497)     =     10.45
       Model |  1068229.39        11  97111.7632   Prob > F        =    0.0000
    Residual |  32509424.8     3,497  9296.37539   R-squared       =    0.0318
-------------+----------------------------------   Adj R-squared   =    0.0288
       Total |  33577654.2     3,508  9571.73722   Root MSE        =    96.418

--------------------------------------------------------------------------------------
          extraction |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------+----------------------------------------------------------------
            year_run |  -5.850585    1.99412    -2.93   0.003    -9.760341   -1.940828
                     |
   inside#c.year_run |
                  1  |  -4.281457   3.386432    -1.26   0.206    -10.92104    2.358126
                     |
              inside |   44.85629   11.24386     3.99   0.000     22.81111    66.90148
                     |
year_run#county_code |
                1 2  |  -18.46332     7.7634    -2.38   0.017    -33.68457   -3.242066
                2 1  |   16.90364   7.844171     2.15   0.031     1.524024    32.28326
                2 2  |  -7.925455   6.616314    -1.20   0.231    -20.89768    5.046773
                3 1  |   26.85867   7.429792     3.61   0.000      12.2915    41.42583
                3 2  |  -1.524664   5.941939    -0.26   0.798    -13.17468    10.12535
                4 1  |   23.85888   7.239917     3.30   0.001     9.663987    38.05377
                4 2  |   .3318529   5.802396     0.06   0.954    -11.04457    11.70828
                5 1  |   13.88067    7.65396     1.81   0.070    -1.126006    28.88735
                5 2  |          0  (omitted)
                     |
               _cons |   73.47847   8.207826     8.95   0.000     57.38586    89.57108
--------------------------------------------------------------------------------------
(est2 stored)

. estadd local year  " "

added macro:
               e(year) : " "

. estadd local yc "\checkmark"    

added macro:
                 e(yc) : "\checkmark"

. restore

. esttab using "Tables\Ptrends_table_year_$outputdate.tex", label replace ///
>         se star(* .10 ** .05 *** .01) scalars( "year Year FE" "yc Year-County FE") ///
>         cells(b(star fmt(2)) se(par fmt(2))) 
(output written to Tables\Ptrends_table_year_20231129.tex)

. 
end of do-file

. log close
      name:  <unnamed>
       log:  D:\Ellen\Dropbox\Pajaro_AgInnovation\Submission\JAERE\Replication_Code\Log\D
> inD_annual_log.log
  log type:  text
 closed on:  29 Nov 2023, 16:55:02
-----------------------------------------------------------------------------------------
